package com.feng.common.validation.constraints;

import com.feng.common.validation.validator.OneOrZeroValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author Feng
 * @since 2022/4/19 17:11
 */

@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = OneOrZeroValidator.class)
public @interface OneOrZero {
    String message() default "值只能是0或1";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
